/* 
 * File:   Controle_gui.cpp
 * Author: filiagees
 * 
 * Created on March 9, 2013, 11:30 PM
 */

#include "Controle_gui.h"
#include "Quadrado.h"

Controle_gui::Controle_gui() {
    this->setTitulo("Hello World!");
}

Controle_gui::Controle_gui(const Controle_gui& orig) {
}

Controle_gui::~Controle_gui() {
}

void Controle_gui::setTitulo(string Titulo){
    this->titulo = Titulo;
}
string Controle_gui::getTitulo(){
    return this->titulo;
}

void Controle_gui::init(int argc, char** argv, void(*callback)(void) ){
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize(500, 500);
    
    glutCreateWindow( this->getTitulo().c_str() );
    
    glutDisplayFunc( callback );
    glutMainLoop();   
}

// static 
/**
 * Essa função será executada continuamente pelo OpenGL.
 */
void Controle_gui::displayCall() {
/*
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glEnable(GL_DEPTH_TEST);

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0, 500, 0, 500, -2.0, 100.0);

  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(0, 0, 20 , 0.0, 0.0, 0.0 , 0.0, 1.0, 0.0);
  
  //glColor3f(1,1,0);
  Quadrado *q = new Quadrado();
  
  /*
  glScalef(.005,.005,.005);
  glRotatef(20, 0, 1, 0);
  glRotatef(30, 0, 0, 1);
  glRotatef(5, 1, 0, 0);
  glTranslatef(-300, 0, 0);
  */
  
  //glutStrokeCharacter(GLUT_STROKE_ROMAN, 'H');
        
  //glutSwapBuffers();
}
